//------------------------------------------------------------------------------
#ifndef __CCHAMP_H__
#define __CCHAMP_H__
//------------------------------------------------------------------------------
#include <QString>
#include <QMessageBox>
#include <QVariant>
//------------------------------------------------------------------------------
enum EAttribut {atNone=0, atObligatoire=1, atRecherche=2, atObligatoireConditionel=4, atRechercheCalcul=8, atChampCalcul=16};
//------------------------------------------------------------------------------
class CChamp
{
	public:
		CChamp(void);
		virtual ~CChamp(void) {}
		void setChamp(QString value) { _champ=value; }
		QString getChamp(void) { return _champ; }
		void setTable(QString value) { _table=value; }
		QString getTable(void) { return _table; }
		void setChampRemp(QString value) { _champRemp=value; }
		QString getChampRemp(void) { return _champRemp; }
		void setTableRemp(QString value) { _tableRemp=value; }
		QString getTableRemp(void) { return _tableRemp; }
		EAttribut getAttribut(void) { return _attribut; }
		QString getDescription(void) { return _description; }
		void setDescription(QString value) { _description=value; }
		QString getCondition(void) { return _condition; }
		void setCondition(QString value) { _condition=value; }
		QString getTextCondition(void) { return _textCondition; }
		void setDefaultValue(QString value) { _defaultValue=value; }
		QString getDefaultValue(void) { return _defaultValue; }
		void setStandaloneEnable(bool value) { _standaloneEnable=value; }
		bool getStandaloneEnable(void) { return _standaloneEnable; }
		void init(void) { setValue(QVariant(_defaultValue)); }
		void setNbDecimal(int nbDecimal) { _nbDecimal=nbDecimal; }
		int getNbDecimal(void) { return _nbDecimal; }
		void setData(QVariant data) { this->data=data; }
		QVariant getData(void) { return data; }

		virtual QString getValue(void) = 0;
		virtual void setValue(QVariant value) = 0;
		virtual void setStateEnable(bool enable) = 0;		
		virtual void setAttribut(EAttribut value) = 0;
		virtual void setTextCondition(QString value) = 0;
		virtual bool isEmpty(void) = 0;
	protected:
		QString _champ;
		QString _table;
		QString _champRemp;
		QString _tableRemp;
		EAttribut _attribut;
		QString _description;
		QString _condition;
		QString _textCondition;
		bool _standaloneEnable;
		QString _defaultValue;
		int _nbDecimal;
		QVariant data;
};
//------------------------------------------------------------------------------
#endif //__CCHAMP_H__
//------------------------------------------------------------------------------
